Skip to content

Conversation

DiannaHohensee
Copy link
Contributor

Change the log-levels in the monitor to use debug for activity and
trace for no activity. This supports enabling DEBUG logging in
production to show when the write load logic activates.

Closes ES-13139

Change the log-levels in the monitor to use debug for activity and
trace for no activity. This supports enabling DEBUG logging in
production to show when the write load logic activates.

Closes ES-13139
@DiannaHohensee DiannaHohensee self-assigned this Oct 7, 2025
@DiannaHohensee DiannaHohensee added >non-issue :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0 labels Oct 7, 2025
@DiannaHohensee DiannaHohensee requested a review from ywangd October 7, 2025 21:09
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

} else {
logger.debug("Not calling reroute because we called reroute recently and there are no new hot spots");
logger.debug(
"Not calling reroute because we called reroute [{}] ago and there are no new hot spots",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Not calling reroute because we called reroute [{}] ago and there are no new hot spots",
"Not calling reroute because we called reroute [{}] ago or there are no new hot spots",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is and. If either enough time passed or a new hot spot, then the if-statement triggers. So the else-statement is when time has not passed AND there are no new hot-spots.

I tried to make that a bit clearer with the new comment before the if-else statement, but seems still tricky.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err you are right.

""",
nodeSummary(nodeIdsExceedingLatencyThreshold),
state.nodes().size(),
lastRerouteTimeMillis == 0 ? "never" : TimeValue.timeValueMillis(timeSinceLastRerouteMillis),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With never, the log message will be was last called [never] ago which reads rather odd. I suggest we either just use TimeValue.timeValueMillis(timeSinceLastRerouteMillis) similar to how that is used in the else branch. Or adjust the logging message further so it reads something like was never called. Also, it would be great to handle it similarly here and in the else branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it doesn't flow. I figured that it was clear, but I can make it better 👍

The else-statement has the advantage of not encountering never because it's logically impossible (haveCalledRerouteRecently is always true in that branch). Doesn't apply in this case.

@DiannaHohensee DiannaHohensee added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Oct 8, 2025
@DiannaHohensee DiannaHohensee merged commit b7237d3 into elastic:main Oct 8, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >non-issue Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants